package neuralModel.activationFunction;


public class LinearActivationFunction implements IActivationFunction {

	private double slope;
	private double yIntercept;

	public LinearActivationFunction() {
		this(1, 0);
	}

	public LinearActivationFunction(double slope, double yIntercept) {
		this.slope = slope;
		this.yIntercept = yIntercept;
	}

	@Override
	public double calculateOutputValue(double inducedLocalField) {
		return slope * inducedLocalField + yIntercept;
	}

	@Override
  public double calculateDerivative(double inducedLocalField)
  {
	  return inducedLocalField;
  }

}
